﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Rechargeable.Migrations
{
    public partial class machine_v2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AppMachineRecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    Desc = table.Column<string>(maxLength: 1024, nullable: false),
                    MachineId = table.Column<Guid>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppMachineRecords", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppMachineRecords_AppMachines_MachineId",
                        column: x => x.MachineId,
                        principalTable: "AppMachines",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_AppMachineRecords_MachineId",
                table: "AppMachineRecords",
                column: "MachineId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AppMachineRecords");
        }
    }
}
